/*
 * Task_Timer.c
 *
 *  Created on: 2018-3-24
 *      Author: root
 */

#ifndef TASK_TIMER_C_
#define TASK_TIMER_C_

#include "Task_Timer.h"
#include "stddef.h"
#include <unistd.h>
#include <sys/select.h>
#include "program.h"
#include "sys.h"
TTaskInfo Info_Task_Timer;
#define TIMER_1S   1
#define TIMER_3S   3
static void timer_1s(void)//1秒一次
{
    addtime_main_1s(TIMER_1S);
}

static  OS_TaskRet Main_Task_Timer(void *arg)
{
	while(1)
	{
          sleep(1);
          timer_1s();
//          i++;
//          if(i%3==0)
//        	  timer_3s();
	}
	return NULL;
}

void initTask_Timer_main(void)
{

	Info_Task_Timer.Prio = 100;
	Info_Task_Timer.Stk = NULL;
	Info_Task_Timer.Stk_Size = 0;

    os_create_task(Main_Task_Timer, NULL, &Info_Task_Timer);
}

#endif /* TASK_TIMER_C_ */
